#include "CCustomCameraView.h"
#include <QPainter>
#include <QStyleOptionGraphicsItem>

CCustomCameraView::CCustomCameraView(QWidget * parent)
	: QVideoWidget(parent)
{
	img_.fill(Qt::black);
}

void CCustomCameraView::clearImage()
{
	img_.fill(Qt::black);
	update();
}

void CCustomCameraView::UpdateImage(QImage img)
{
	img_ = img;
	update();
}

void CCustomCameraView::paintEvent(QPaintEvent * event)
{
	QPainter p(this);
	p.fillRect(rect(), Qt::black);
	p.drawImage(rect(), img_);
}
